using System;
using System.Collections.Generic;
namespace Lcygcc.Infrastructure.Utility.IOC
{
	public class Singleton
	{
		private static readonly IDictionary<Type, object> allSingletons;
		public static IDictionary<Type, object> AllSingletons
		{
			get
			{
				return Singleton.allSingletons;
			}
		}
		static Singleton()
		{
			Singleton.allSingletons = new Dictionary<Type, object>();
		}
	}
	public class Singleton<T> : Singleton
	{
		private static T instance;
		public static T Instance
		{
			get
			{
				return Singleton<T>.instance;
			}
			set
			{
				Singleton<T>.instance = value;
				Singleton.AllSingletons[typeof(T)] = value;
			}
		}
	}
}
